<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>丙寅命理 · 免费排盘</title>
  <style>
    body {
      font-family: "Microsoft YaHei", sans-serif;
      background: #fdf6e3;
      padding: 20px;
      color: #333;
    }
    .box {
      max-width: 500px;
      margin: 0 auto;
      background: white;
      padding: 25px;
      border-radius: 15px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    h2 {
      text-align: center;
      color: #d33682;
      margin-bottom: 25px;
    }
    input {
      width: 100%;
      padding: 12px;
      margin: 10px 0;
      border: 1px solid #ccc;
      border-radius: 8px;
      font-size: 16px;
    }
    button {
      width: 100%;
      background: #d33682;
      color: white;
      border: none;
      padding: 14px;
      font-size: 18px;
      border-radius: 10px;
      margin: 20px 0;
    }
    .result {
      background: #f9f9f9;
      padding: 15px;
      border-radius: 10px;
      white-space: pre-wrap;
      margin-top: 20px;
    }
    .note {
      text-align: center;
      margin-top: 25px;
      color: #cb4b16;
      font-weight: bold;
    }
  </style>
</head>
<body>
  <div class="box">
    <h2>✨ 丙寅命理 · 免费自助排盘</h2>
    
    <input id="year" placeholder="年干（例：丙）">
    <input id="month" placeholder="月支（例：辰）">
    <input id="day" placeholder="日支（例：巳）">
    <input id="hour" placeholder="时支（例：亥）">
    
    <button onclick="go()">立即分析</button>
    
    <div id="out" class="result" style="display:none;"></div>
    
    <div class="note">
      🔔 本结果为基础参考<br>
      详细分析（用神/大运/流年）请私信【丙寅】老师
    </div>
  </div>

  <script>
    function go() {
      let y = document.getElementById('year').value.trim();
      let m = document.getElementById('month').value.trim();
      let d = document.getElementById('day').value.trim();
      let h = document.getElementById('hour').value.trim();
      
      if (!y || !m || !d || !h) {
        alert('请填满四柱');
        return;
      }

      const 干 = {"甲":"木","乙":"木","丙":"火","丁":"火","戊":"土","己":"土","庚":"金","辛":"金","壬":"水","癸":"水"};
      const 支 = {"寅":"木","卯":"木","巳":"火","午":"火","辰":"土","戌":"土","丑":"土","未":"土","申":"金","酉":"金","亥":"水","子":"水"};
      const 情 = {"木":"怒","火":"喜","土":"思","金":"悲","水":"恐"};
      const 季 = {"木":"春","火":"夏","土":"长夏","金":"秋","水":"冬"};

      let res = `【丙寅命理 · 免费版】\n`;
      res += `年干：${y} → ${情[干[y]] || '？'}\n`;
      res += `月支：${m} → ${季[支[m]] || '？'}\n`;
      res += `日支：${d} → ${干[d] ? '天干' : (支[d] || '？')}\n`;
      res += `时支：${h} → ${支[h] || '？'}\n\n`;
      res += `📌 提示：此为通用分析，仅供参考。\n`;
      res += `✅ 深度解读请找丙寅本人！`;

      document.getElementById('out').innerText = res;
      document.getElementById('out').style.display = 'block';
    }
  </script>
</body>
</html>